﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NMF.Languages
{
    public abstract class DataType : IType
    {
        public abstract System.Type SystemType { get; }
        private string name;

        public DataType(string name)
        {
            this.name = name;
        }

        public virtual void Visit(ITypeVisitor visitor)
        {
            visitor.VisitOther(this);
        }

        public virtual T Visit<T>(ITypeVisitor<T> visitor)
        {
            return visitor.VisitOther(this);
        }

        public virtual T Visit<S, T>(ITypeVisitor<S, T> visitor, S parameter)
        {
            return visitor.VisitOther(this, parameter);
        }

        public string Name
        {
            get { return name; }
        }

        public virtual void SetAlias(string name)
        {
            this.name = name;
        }
    }
}
